@echo off
set CurrentPath=%~dp0
set P1Path=
:begin
for /f "tokens=1,* delims=\" %%i in ("%CurrentPath%") do (set content=%%i&&set CurrentPath=%%j)
if "%P1Path%%content%\" == "%~dp0" goto end
set P1Path=%P1Path%%content%\
goto begin
:end
echo P1Path=%P1Path%
FOR /f "tokens=1-3 delims=: skip=1 eol=#" %%i IN ('findstr /n ".*" %P1Path%JM_config') DO (
if %%i == 2 ssh administrator@%%j "cd C:\Users\Administrator\jmeterEnv\Matset_jmx & rd /s/q report & del *.jtl,*.log"
)
pause


rem 删除历史压测报告
:: if %%i == 2  ,只取第一行 

:: onlyOneRow 结尾的是只运行配置文件的第一组，第2行数据